<form i="form:manage:modifypwd" action="<!--{iCMS:route url='UserProfile'}-->" method="POST">
    <input type="hidden" name="action" value="modifypwd" />
    <div class="block" style="max-width: 300px">
        <div class="block-content p-0">
            <div class="form-group">
                <label for="password">原密码</label>
                <input type="password" class="form-control" id="password" name="password" value="" />
            </div>
            <div class="form-group">
                <label for="pwd">新密码</label>
                <input type="password" class="form-control" id="passwd" name="passwd" value="" />
            </div>
            <div class="form-group">
                <label for="pwd">确认新密码</label>
                <input type="password" class="form-control" id="passwd-confirm" name="passwd-confirm" value="" />
            </div>
            <div class="form-group">
                <label for="captcha">图形验证码</label>
                <div class="input-group">
                    <input type="text" maxlength="4" class="form-control" id="captcha" name="captcha" placeholder="图形验证码" />
                    <div class="input-group-append">
                        <!--{iCMS:public:captcha class="rounded-right"}-->
                    </div>
                </div>
            </div>
            <div class="form-group">
                <button type="submit" class="btn btn-alt-primary btn-block">修改密码</button>
            </div>
        </div>
    </div>
</form>
<script>
    jQuery(() => {
        submit("密码修改", "form:manage:modifypwd", {
            rules: {
                password: {
                    required: true,
                    minlength: 6,
                },
                passwd: {
                    required: true,
                    minlength: 6,
                },
                "passwd-confirm": {
                    required: true,
                    equalTo: "#passwd",
                },
                captcha: {
                    required: true,
                },
            },
            messages: {
                password: {
                    required: "请输入您的密码",
                    minlength: "密码不能少于6个字符",
                },
                passwd: {
                    required: "请输入您的新密码",
                    minlength: "新密码不能少于6个字符",
                },
                "passwd-confirm": {
                    required: "请确认您的密码",
                    minlength: "确认密码不能少于6个字符",
                    equalTo: "确认密码与您的密码不一致",
                },
                captcha: "请输入图形验证码",
            },
        });
    });
</script>
